#_*_coding:utf-8_*_
user_status = True
def login(auth_type):
    def auth(func):
        def inner(*args,**kwargs):
            if auth_type == 'local':
                username = 'abc'
                password = '123'
                global user_status
                while user_status:
                    _username = input('please input username:')
                    _password = input('please input password:')
                    if _username == username and _password == password:
                        print('登录成功！！')
                        user_status = False  #登录成功之后跳出循环
                        func(*args,**kwargs)
                    else:

                        print('请输入正确的用户名密码')
            elif auth_type == 'qq':
                print('qq auth start____')
                func(*args,**kwargs)
        return inner
    return auth


def index():
    print('welcome to index')
@login('qq')
def home(ss):
    print('welcome to home',ss)

@login('local')
def setting():
    print('in the setting')

index()
home('12')
setting()